class Gun:
    def __init__(self,model):
        self.model = model
        self.bullet_count = 0

    def add_bullet(self,count):
        self.bullet_count += count

    def shoot(self):
        if self.bullet_count == 0:
            print('没有子弹了')
            return

        self.bullet_count -= 1
        print(f'开火，剩余子弹为{self.bullet_count}')


class Soldier:
    def __init__(self,name):
        self.name = name

        self.gun:Gun = None

    def fire(self):

        if self.gun == None:
            print(f'{self.name} 还没有枪，快跑')

            return

        print(f'冲啊{self.name},为了帝国')

        self.gun.add_bullet(50)

        self.gun.shoot()

ak47 = Gun('ak47')

xusanduo = Soldier('许三多')

xusanduo.gun = ak47

xusanduo.fire()

print(xusanduo.name)



a = [1,2,3]
b = [1,2,3]

print(a == b)
print(a is b)

